package com.chenjun.mysite.module.sys.service;

import java.util.ArrayList;
import java.util.List;

import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;

import com.chenjun.mysite.common.AbstractBaseService;
import com.chenjun.mysite.common.SqlSessionFactoryUtil;
import com.chenjun.mysite.module.sys.entity.Menu;
import com.chenjun.mysite.module.sys.mapper.IMenuMapper;

public class MenuService extends AbstractBaseService<Menu,IMenuMapper>
{
	public List<Menu> findByMenuCategoryId(Long menuCategoryId)
	{
		List<Menu> list = new ArrayList<Menu>(0);
		SqlSessionFactory sqlSessionFactory =  SqlSessionFactoryUtil.getInstance();
		SqlSession sqlSession = null;
		try
		{
			sqlSession = sqlSessionFactory.openSession();
			IMenuMapper mapper = sqlSession.getMapper(IMenuMapper.class);
			list = mapper.findByMenuCategoryId(menuCategoryId);
		}
		catch(Exception e)
		{
			
		}
		finally
		{
			sqlSession.close();
		}
		return list;
	}
}
